//
//  YYJLAllConmentController.m
//  YuanyangJinlou
//
//  Created by mac004 on 2017/1/6.
//  Copyright © 2017年 suli19910309@qq.com. All rights reserved.
//

#import "YYJLAllConmentController.h"
#import "YYJLAllconmentCell.h"
@interface YYJLAllConmentController ()<UITableViewDataSource,UITableViewDelegate>
{
    UITableView * _tableview;
}

@end

@implementation YYJLAllConmentController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    [self setTitleView:@"查看全部评论"];
    [self setBackItem];
    [self creatUI];
    
}
-(void)creatUI{
    _tableview=[[UITableView alloc]initWithFrame:CGRectMake(0, 0, SCREEN_WIDTH, SCREEN_HEIGHT) style:UITableViewStylePlain];
    _tableview.dataSource=self;
    _tableview.delegate=self;
    _tableview.tableHeaderView=[self addHeaderView];
    _tableview.separatorStyle=UITableViewCellSeparatorStyleNone;
    [self.view addSubview:_tableview];
    
    UIView * bottomView=[[UIView alloc]initWithFrame:CGRectMake(0, SCREEN_HEIGHT-44*PER_HEIGHT, SCREEN_WIDTH, 44*PER_HEIGHT)];
    bottomView.backgroundColor=UIColorFromHex(0xe6e6e6);
    [self.view addSubview:bottomView];
    UITextField* TF=[MyControl createTextFieldWithFrame:CGRectMake(62*PER_WIDTH, 7.5*PER_HEIGHT, 250*PER_WIDTH, 29*PER_HEIGHT) placeholder:@"我来说两句..." passWord:NO leftImageView:nil rightImageView:nil];
    [bottomView addSubview:TF];
}

-(UIView*)addHeaderView{
    UIView * headerView=[[UIView alloc]initWithFrame:CGRectMake(0, 0, SCREEN_WIDTH, 44*PER_HEIGHT)];
    UILabel * lab =[MyControl createLabelWithFrame:CGRectMake(12*PER_WIDTH, 15*PER_HEIGHT, 100, 14*PER_HEIGHT) Font:14 Text:@"全部评论" Color:BLACK_COLOR];
    [headerView addSubview:lab];
    UIView*view=[[UIView alloc]initWithFrame:CGRectMake(0, 44*PER_HEIGHT-0.5, SCREEN_WIDTH, 0.5)];
    view.backgroundColor=BLACK_COLOR;
    [headerView addSubview:view];
    return headerView;
}

#pragma mark--tableview
-(NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{
    return 2;
}
-(CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath{
    return 100*PER_HEIGHT;
}
-(UITableViewCell*)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
    YYJLAllconmentCell*cell=[tableView dequeueReusableCellWithIdentifier:@"cell"];
    if (!cell) {
        cell=[[YYJLAllconmentCell alloc]initWithStyle:UITableViewCellStyleDefault    reuseIdentifier:@"cell"];
    }
    return cell;
}
- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
